/**
 * 功能描述：经销商看板关接口
 */

import { baseUrl, Get, Post } from '../../server'
const severName = 'userserver/' // 服务前缀名
const severGlobalName = 'bigdata/' // 服务前缀名
const newBaseUrl = baseUrl + severName
const newGlobalBaseUrl = baseUrl + severGlobalName

/**
 * 功能描述：获取接口版本号。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32907
 */
const dealerBasicInterfaceversioninfo: any = () => {
  const url = `${newGlobalBaseUrl}api/basic/interfaceversioninfo`
  return Get(url)
}

/**
 * 功能描述：获取经销商个人信息。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32607
 */
const distributorBasicInfo: any = (params) => {
  const url = `${newBaseUrl}api/distributor/distributorbasicinfo`
  return Post(url, params)
}

/**
 * 功能描述：网络情况--网络人数,活跃人数,有效人数,新人人数。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32611
 */
const networkOveRview = (params) => {
  const url = `${newBaseUrl}api/distributor/networkoverview`
  return Post(url, params)
}

/**
 * 功能描述：新人增涨趋势。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32615
 */
const dealerGrowthTrend = (params) => {
  const url = `${newBaseUrl}api/distributor/growthtrend`
  return Post(url, params)
}

/**
 * 功能描述：荣衔徽章,级别徽章 。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32619
 */
const dealerBadgeInfo = (params) => {
  const url = `${newBaseUrl}api/distributor/badgeinfo`
  return Get(url, params)
}

/**
 * 功能描述：经销商网络树--保持和DIMP系统一致数据口径 。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32623
 */
const dealerNetWork = (params) => {
  const url = `${newBaseUrl}api/distributor/network`
  return Post(url, params)
}

/**
 * 功能描述：整网业绩增涨趋势。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32627
 */
const dealerNetworkGrowthTrend = (params) => {
  const url = `${newBaseUrl}api/distributor/zwtrend`
  return Post(url, params)
}

/**
 * 功能描述：奖金构成。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32967
 */
const dealerPriceDetailPie: any = (params) => {
  const url = `${newBaseUrl}api/distributor/bonusChart`
  return Post(url, params)
}

/**
 * 功能描述：整网业绩饼状图。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32631
 */
const dealerTotalWebsitePie: any = (params) => {
  const url = `${newBaseUrl}api/distributor/pvChart`
  return Post(url, params)
}

/**
 * 功能描述：奖金整网业绩占比。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32975
 */
const dealerScaleInfo: any = (params) => {
  const url = `${newBaseUrl}api/distributor/scaleInfo`
  return Post(url, params)
}

/**
 * 功能描述：整网业绩。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/33063
 */
const dealerDistributorZwall: any = () => {
  const url = `${newBaseUrl}api/distributor/zwall`
  return Get(url)
}

/**
 * 功能描述：升级助手。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32635
 */
// const dealerDisupgradeinfo: any = () => {
//   const url = `${newBaseUrl}api/distributor/disupgradeinfo`
//   return Get(url)
// }

/**
 * 功能描述：升级助手方案。
 * yapi地址：http://yapi.tiens.com/project/550/interface/api/32727
 */
//

// const dealerGetplaninfo: any = ({ params }) => {
//   const url = `${newBaseUrl}api/distributor/getplaninfo`
//   return Get(url, params)
// }

export const dealerDataApi: any = {
  dealerBasicInterfaceversioninfo,
  networkOveRview,
  dealerGrowthTrend,
  dealerBadgeInfo,
  dealerNetWork,
  dealerNetworkGrowthTrend,
  dealerPriceDetailPie,
  dealerTotalWebsitePie,
  dealerScaleInfo,
  dealerDistributorZwall,
  // dealerDisupgradeinfo,
  // dealerGetplaninfo,
  distributorBasicInfo,
}
